//返回头部
$(function(){
    $(window).scroll(function(){
        $(".daohang-bottom-b3").click(function(){
            $("html,body").stop().animate({scrollTop:0},1000)
        })
    })
})
//轮播图
var $oBanner = $(".sy-banner")
var $oLis = $(".sy-banner ul li")
console.log($oLis);
var $oOls = $(".sy-banner .sy-banner-d li")
var timer = null;
var num = 0;
function autoPlay(){
    timer = setInterval(function(){
        num++;
        num = num%$oLis.length;
        $oLis.eq(num).stop().fadeIn(1000).siblings().fadeOut(1000);
        $oOls.eq(num).addClass("active").siblings().removeClass("active")
    },2000)
}
autoPlay()
$oBanner.mouseenter(function(){
    clearInterval(timer)
}).mouseleave(function(){
    autoPlay()
})
$oOls.click(function(){
    let index = $(this).index()
    num = index;
    $oLis.eq(num).stop().fadeIn(1000).siblings().fadeOut(800);
    $oOls.eq(num).addClass("active").siblings().removeClass("active")
})

//teb切换
var oPs = $(".line9-top p")
var oDiv = $(".line9-bottom div")
for (let i = 0; i < oPs.length; i++) {
    oPs[i].onclick = function () {
            for (var j = 0; j < oPs.length; j++) {
                oPs[j].className = i == j ? 'active' : '';
                oDiv[j].className = i == j ? 'line9-bottom-txt1 l9-current' : '';
            }
    }
}

var oYY = document.querySelector(".li3-list-left")
var oDD = document.querySelector(".ppp")
var olist = document.querySelectorAll(".ppp li")
oYY.onmouseenter = function(){
    oDD.style.display = "block"
}
oDD.onmouseleave = function(){
    oDD.style.display = "none"
}
    
